package com.fyh.hiring.talent.dao;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.fyh.hiring.common.DBObject;
import com.fyh.hiring.common.util.JDBCUtil;
import com.fyh.hiring.talent.entity.ResumeEntity;

/**
 * 
 * @author 付元辉
 *显示当前登陆者的所有简历信息
 * @since 2016年3月1日
 */
public class ResumeDao {
	
	public List<ResumeEntity> listResume(int talentId){
		List<ResumeEntity> listResume = new ArrayList<ResumeEntity>();
		DBObject dbObject = null;
	    String sql = "SELECT * FROM resume where talent_id= ?";
	    try{
	    	dbObject =JDBCUtil.executeQuery(sql, talentId);
	    	ResultSet resultSet =dbObject.getResultSet();
	    	while(resultSet.next()){
	    		ResumeEntity resumeEntity = new ResumeEntity();
	    		 resumeEntity.setId(resultSet.getInt("id"));
	    		 resumeEntity.setIntention(resultSet.getString("intention"));
	    		 resumeEntity.setWorkExperience(resultSet.getString("work_experience"));
	    		 resumeEntity.setProjectExperience(resultSet.getString("project_experience"));
	    		 
	    		 listResume.add(resumeEntity);
	    	}
	    }catch(Exception e){
	    	e.printStackTrace();
	    }
		return listResume;
		
	}
}
